/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author ubuntu
 */
@Entity
@Table(name = "mohon_maklumat_kumpulan")
@NamedQueries({
    @NamedQuery(name = "PermohonanMaklumatKumpulan.findAll", query = "SELECT p FROM PermohonanMaklumatKumpulan p")})
public class PermohonanMaklumatKumpulan implements Serializable {
//    private String registrationSts;
    private static final long serialVersionUID = 1L;   
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_mohon_maklumat_kumpulan")
    private Integer idMohonMaklumatKumpulan;
    
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "id_mohon_maklumat")
    private PermohonanMaklumat permohonan;
    
    @Column(name = "flag")
    private String flag;
    
    @Column(name = "nama")
    private String nama;
    
    @Basic(optional = false)
    @Column(name = "no_pengenalan")
    private String noPengenalan;
    
    @Basic(optional = false)
    @Column(name = "no_akaun")
    private String noAkaun;
    
    @Column(name = "id_kumpulan")
    private String id;
    
    @Column(name = "status_tambahan")
    private String statusTambahan;  
    
    @Column(name = "kod_status")
    private KodStatus status;
    
    @ManyToOne()
    @JoinColumn(name = "kod_hubungan")
    private KodHubungan hubungan;
    
    @ManyToOne
    @JoinColumn(name = "kod_status_haji")
    private KodStatusHaji statushaji;    
    
    @Embedded
    private InfoAudit infoAudit;
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMohonMaklumatKumpulan != null ? idMohonMaklumatKumpulan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PermohonanMaklumatKumpulan)) {
            return false;
        }
        PermohonanMaklumatKumpulan other = (PermohonanMaklumatKumpulan) object;
        if ((this.idMohonMaklumatKumpulan == null && other.idMohonMaklumatKumpulan != null) || (this.idMohonMaklumatKumpulan != null && !this.idMohonMaklumatKumpulan.equals(other.idMohonMaklumatKumpulan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.PermohonanMaklumatKumpulan idMohonMaklumatKumpulan=" + idMohonMaklumatKumpulan + " ]";
    }

    public Integer getIdMohonMaklumatKumpulan() {
        return idMohonMaklumatKumpulan;
    }

    public void setIdMohonMaklumatKumpulan(Integer idMohonMaklumatKumpulan) {
        this.idMohonMaklumatKumpulan = idMohonMaklumatKumpulan;
    }

    public PermohonanMaklumat getPermohonan() {
        return permohonan;
    }

    public void setPermohonan(PermohonanMaklumat permohonan) {
        this.permohonan = permohonan;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    public String getNoPengenalan() {
        return noPengenalan;
    }

    public void setNoPengenalan(String noPengenalan) {
        this.noPengenalan = noPengenalan;
    }

    public String getNoAkaun() {
        return noAkaun;
    }

    public void setNoAkaun(String noAkaun) {
        this.noAkaun = noAkaun;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public KodHubungan getHubungan() {
        return hubungan;
    }

    public void setHubungan(KodHubungan hubungan) {
        this.hubungan = hubungan;
    }

    public KodStatusHaji getStatushaji() {
        return statushaji;
    }

    public void setStatushaji(KodStatusHaji statushaji) {
        this.statushaji = statushaji;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    public String getStatusTambahan() {
        return statusTambahan;
    }

    public void setStatusTambahan(String statusTambahan) {
        this.statusTambahan = statusTambahan;
    }

    public KodStatus getStatus() {
        return status;
    }

    public void setStatus(KodStatus status) {
        this.status = status;
    }
    
    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getFlag() {
        return flag;
    }
}
